package light.mvc.model.workflow;

import java.util.LinkedHashSet;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.OneToMany;
import javax.persistence.OrderBy;
import javax.persistence.Table;

import light.mvc.model.base.IdEntity;

/**
 * 表单模板
 * 
 * @author tyg
 * 
 */
@Entity
@Table(name = "workflow_formTemplate")
public class TformTemplate extends IdEntity implements java.io.Serializable{
	private String name;
	private String processDefinitionKey;
	private String pdid;
	private String path; // 文件存储的路径
	private Set<Tfield> fields = new LinkedHashSet<Tfield>();

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getProcessDefinitionKey() {
		return processDefinitionKey;
	}

	public void setProcessDefinitionKey(String processDefinitionKey) {
		this.processDefinitionKey = processDefinitionKey;
	}

	public String getPath() {
		return path;
	}

	public void setPath(String path) {
		this.path = path;
	}
	@OneToMany(fetch = FetchType.EAGER, cascade = { CascadeType.ALL }, mappedBy = "formTemplate")
	@OrderBy("id ASC") 
	public Set<Tfield> getFields() {
		return fields;
	}

	public void setFields(Set<Tfield> fields) {
		this.fields = fields;
	}

	public String getPdid() {
		return pdid;
	}

	public void setPdid(String pdid) {
		this.pdid = pdid;
	}


}
